]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenSaver: bugfixes
authorDan Winship <danw@gnome.org>
Wed, 13 Jul 2011 19:07:39 +0000 (15:07 -0400)
committerDan Winship <danw@gnome.org>
Thu, 14 Jul 2011 16:51:18 +0000 (12:51 -0400)
Fix the signal handling; you can't use this.connect('ActiveChanged')
to connect to a D-Bus signal after replacing the signal methods with
the lang.signals versions. Just leave it using the D-Bus signal names,
just like it uses the D-Bus method names.

Also, remove the "_" from "_screenSaverActive", to match what
AutomountManager checks for, and remove getActive(), since it's not
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=654550

js/misc/screenSaver.js
js/ui/automountManager.js

index da592f6c831edaebe77c4a75f8d3b01908ac5d6a..f9d6af867c801e88a8e9726121311c7de2a69dac 100644 (file)
@@ -2,7 +2,6 @@
 
 const DBus = imports.dbus;
 const Lang = imports.lang;
-const Signals = imports.signals;
 
 const ScreenSaverIface = {
     name: 'org.gnome.ScreenSaver',
@@ -32,28 +31,23 @@ ScreenSaverProxy.prototype = {
                                 Lang.bind(this, this._onSSAppeared),
                                 Lang.bind(this, this._onSSVanished));
 
+        this.screenSaverActive = false;
         this.connect('ActiveChanged',
                      Lang.bind(this, this._onActiveChanged));
     },
 
     _onSSAppeared: function(owner) {
         this.GetActiveRemote(Lang.bind(this, function(isActive) {
-            this._screenSaverActive = isActive;
+            this.screenSaverActive = isActive;
         }))
     },
 
     _onSSVanished: function(oldOwner) {
-        this._screenSaverActive = false;
+        this.screenSaverActive = false;
     },
 
     _onActiveChanged: function(object, isActive) {
-        this._screenSaverActive = isActive;
-        this.emit('active-changed', this._screenSaverActive);
-    },
-
-    getActive: function() {
-        return this._screenSaverActive;
+        this.screenSaverActive = isActive;
     }
 };
 DBus.proxifyPrototype(ScreenSaverProxy.prototype, ScreenSaverIface);
-Signals.addSignalMethods(ScreenSaverProxy.prototype);
index 7afb5515a14ca4c505ba42af8390659c83e7ca8c..93b093ab265cd64f7a513046ac4988c45ce05903 100644 (file)
@@ -86,7 +86,7 @@ AutomountManager.prototype = {
         this.ckListener = new ConsoleKitManager();
 
         this._ssProxy = new ScreenSaver.ScreenSaverProxy();
-        this._ssProxy.connect('active-changed',
+        this._ssProxy.connect('ActiveChanged',
                               Lang.bind(this,
                                         this._screenSaverActiveChanged));
 
@@ -201,7 +201,7 @@ AutomountManager.prototype = {
             if (!this.ckListener.sessionActive)
                 return;
 
-            if (this._ssProxy.getActive()) {
+            if (this._ssProxy.screenSaverActive) {
                 if (this._volumeQueue.indexOf(volume) == -1)
                     this._volumeQueue.push(volume);